<?php
header('Content-Type: text/xml');
print "<?xml version='1.0' encoding='ISO-8859-1'?>";
print "<response><update>";
if ($error == true) print "failed";
else print "completed";
print "</update><msg>" . htmlspecialchars($msg) . "</msg><total>";
print $total;
print "</total><comments>";
if ($comments != null) {
	for ($cntr = 0; $cntr < count($comments); $cntr++) {
		$comment = $comments[$cntr];
		print "<comment><timestamp>";
		print $comment->dt_time;
		print "</timestamp><name>";
		print "<![CDATA[" . $comment->name . "]]>";
		print "</name><location>";
		print "<![CDATA[" . $comment->location . "]]>";
		print "</location><message>";
		print "<![CDATA[" . $comment->message . "]]>";
		print "</message></comment>";
	}
}
print "</comments></response>";
?>
